<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/commons/taglibs.jsp"%>
<!DOCTYPE html >
<html>
<head>
<jsp:include page="/jsp/commons/cssinclude.jsp"></jsp:include>
<jsp:include page="/jsp/commons/scriptinclude.jsp"></jsp:include>
<meta charset="utf-8">
<title>晶品科技信息管理系统-配置管理</title>
<meta name="keywords" content="">
<meta name="description" content="">

<script type="text/javascript">
	//分页查询
	function queryCategory() {
		var path = "${ctx}/syspara/sysparaAction!list.action";
		query(path);

	}
	function queryPage(path, pageindex) {
		pageIndex = pageindex;
		query(path);

	}
	$(document).ready(function() {
		queryCategory();

	});
	//更新类目状态
	function updateCategoryStatus(code, version, name, state) {
		var operStr = "禁用";
		if (state == 'Y') {
			operStr = "启用";
		}
		var flag = confirm("确认要" + operStr + "'" + name + "'类目？");
		if (flag) {
			var url = "${ctx}/category/categoryAction!operateCategoryState.action";
			//var params = {"category.categoryCode":code,"category.version":version,"category.isValid":state};
			var params = {
				"category.categoryCode" : code,
				"category.isValid" : state
			};
			$.ajax({
				url : url,
				type : 'post',
				data : params,
				dataType : 'json',
				success : function(data) {
					if (data.flag == '1') {
						alert("操作成功");

					} else {

						alert("操作类目失败");
					}
					queryCategory();
				},
				error : function() {
					queryCategory();
				}
			});
		} else {
			return false;
		}
	}
	//导出类目产品
	function expCategoryGoods(code, version, name) {
		$("#expCategoryCode").val(code);
		//$("#expCategoryVersion").val(version);
		var frm = $('#frmQuery');
		var flag = confirm("确认要导出" + "'" + name + "'类目下的产品？");
		if (flag) {
			var url = "${ctx}/category/categoryAction!expCategoryGoods.action";
			frm.attr('action', url);
			frm[0].submit();
		}
		;

	}
</script>
</head>
<body>
	<jsp:include page="/jsp/commons/top.jsp"></jsp:include>
	<div class="mainbox">
		<div class="main_content"><%@include
				file="/jsp/commons/leftMenu.jsp"%>
			<div class="main_right">
				<div class="main_rightbox">
					<!--面包屑 begin-->
					<div class="ec_crumb_kc">
						<span><a class="icon_index" href="${ctx }">返回首页</a></span>当前位置：<a
							style="cursor: pointer; color: #0678BD;" href="${ctx }">首页</a>&nbsp;&gt;&nbsp;<a
							style="cursor: pointer; color: #0678BD;" href="${ctx }">配置管理</a>&nbsp;&gt;&nbsp;<em>用户管理</em>
					</div>
					<!--配置图片 begin-->
					<div class="service">
						<a class="lmImg icon1"
							href="${ctx}/syspara/sysparaAction!sysparaAddInit.action">增加用户</a>



					</div>
					<!--查询 begin-->
					<div class="user">
						<div class="user_search">
							<form id="businessForm" method="post">
								<div class="frm_cont" id="lmname">
									<label for="lmname">用户名称：</label> <input type="text"
										value="请输入名称" id="lmname" onFocus="clearText(this)"
										onBlur="clearText(this)" name="syspara.name" />
								</div>
								<div class="frm_cont" id="flm">
									<label for="flm">字典编码：</label> <input type="text"
										value="请输入字典编码" id="flm" onFocus="clearText(this)"
										onBlur="clearText(this)" name="syspara.key" />
								</div>

							</form>
						</div>
						<div class="tbn_search" id="btncenter">
							<a href="javascript:void(0)"
								onclick="queryPage('${ctx}/category/sysparaAction!list.action',0)">查询</a>
						</div>
						<div class="clear"></div>
					</div>
					<!--表格 & 分页-->
					<div id="Searchresult">
						<table width="100%" border="0" cellspacing="0" cellpadding="0"
							class="tab">
							<tr>
								<th>序号</th>
								<th>字典名称</th>
								<th>字典编码</th>
								<th>字典值</th>
								<th>状态</th>
								<th>类型</th>
								<th>排序</th>
								<th>创建时间</th>
								<th>操作</th>
							</tr>
							<tr>
								<td colspan="8">正在查询...</td>
							</tr>
						</table>
					</div>

				</div>
			</div>
		</div>
	</div>


	<!-- JQ -->
	<script type="text/javascript">
	    function updateStatus(sysparaId,flag){
	    	//提示语
	    	var tip="";
	    	if(flag=="Y"){
	    		tip="启用";
	    	}else{
	    		tip="禁用";
	    	}
	    	
	    	//异步请求修改状态
	    	if(confirm("确定要"+tip+"该条记录？")){
	    		$.post(
	    			    "${ctx}/syspara/sysparaAction!updateState.action", 
	    				{random:Math.random(),"syspara.id":sysparaId,"syspara.state":flag}, 
	    				function(data){
	    					    var jsonData = strToJson(data); 
	    					    if(jsonData.flag=="error"){
	    					    	alert(jsonData.errorMsg);
	    					    }
	    					    window.location.href="${ctx}/syspara/sysparaAction!initSyspara.action";
	    			         }); 
	    	}
	    }
		 
		 
	</script>
</body>
</html>